<%@ Page Language="C#" AutoEventWireup="true" Inherits="Soveryn.Commerce.Pages.CustomerBillingUpdate"
    MasterPageFile="~/Dummy.master" CodeFile="CustomerBillingUpdate.aspx.cs" %>

<asp:Content ID="PageContent" ContentPlaceHolderID="PageContentPlaceHolder" runat="server">
    <div class="orderPageContent">
        <asp:UpdatePanel ID="MainUpdatePanel" runat="server">
            <ContentTemplate>

                <div style="margin: 10px;">
                    If you are a returning customer, <a href='/CustomerLogin.aspx'>click here</a>
                    to Sign In.
                </div>
                <table class="fields" style="border-collapse: separate; border-spacing: 8px;">
                    <tr>
                        <td style="text-align: right; width: 35%; vertical-align: top;">Email Address: </td>
                        <td style="text-align: left;">
                            <asp:Label ID="UserNameEmailLabel" runat="server" Visible="false"></asp:Label>
                            <asp:TextBox ID="UserNameEmailTextBox" MaxLength="100" Width="228" runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="UserNameEmailTextBoxValidator" ControlToValidate="UserNameEmailTextBox"
                                Display="dynamic" ErrorMessage="Required" SetFocusOnError="true" runat="server"
                                ValidationGroup="UpdateCustomerInfoGroup"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="UserNameEmailTextBoxRegxValidator" runat="server"
                                ErrorMessage="<br />Valid Email Required" Display="dynamic" ControlToValidate="UserNameEmailTextBox"
                                SetFocusOnError="true" ValidationGroup="UpdateCustomerInfoGroup" ValidationExpression="^([a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]){0,70}$" />
                        </td>
                    </tr>
                    <tr id="PasswordMessageRow" runat="server">
                        <td></td>
                        <td style="text-align: left;">To create a password&nbsp;<asp:LinkButton ID="ExposePasswordButton"
                            Visible="True" runat="server" OnClick="ExposePasswordButton_Click" Text="click here" />.
                        </td>
                    </tr>
                    <tr id="ChangePasswordRow" runat="server" visible="false">
                        <td></td>
                        <td style="text-align: left;">
                            <asp:LinkButton ID="ChangePasswordLinkButton" runat="server" OnClick="ExposePasswordButton_Click"
                                Text="Change your password" />. </td>
                    </tr>
                    <tr id="PasswordRow" runat="server">
                        <td style="text-align: right; width: 35%;">Password: </td>
                        <td style="text-align: left;">
                            <asp:TextBox ID="PasswordTextBox" TextMode="Password" MaxLength="100" Width="228"
                                runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="PasswordRequiredFieldValidator" ControlToValidate="PasswordTextBox"
                                Display="dynamic" ErrorMessage="Required" SetFocusOnError="true" runat="server"
                                ValidationGroup="UpdateCustomerInfoGroup"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr id="ConfirmPasswordRow" runat="server">
                        <td style="text-align: right;">Confirm Password:</td>
                        <td style="text-align: left;">
                            <asp:TextBox ID="ConfirmPasswordTextBox" TextMode="Password" MaxLength="100" Width="228"
                                runat="server"></asp:TextBox><br />
                            <asp:CompareValidator ID="ConfirmPasswordCompareValidator" ControlToValidate="ConfirmPasswordTextBox"
                                ControlToCompare="PasswordTextBox" ValidationGroup="UpdateCustomerInfoGroup"
                                Display="dynamic" runat="server" ErrorMessage="Passwords do not match." SetFocusOnError="true"></asp:CompareValidator>
                            <asp:RequiredFieldValidator ID="ConfirmPasswordRequiredFieldValidator" ControlToValidate="ConfirmPasswordTextBox"
                                Display="dynamic" ErrorMessage="Required" SetFocusOnError="true" runat="server"
                                ValidationGroup="UpdateCustomerInfoGroup"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;">Company: </td>
                        <td style="text-align: left;">
                            <asp:TextBox ID="BillCompanyNameTextBox" MaxLength="100" Width="228" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;">First Name: </td>
                        <td style="text-align: left;">
                            <asp:TextBox ID="BillFirstNameTextBox" MaxLength="100" Width="228" runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="BillFirstNameValidator" ControlToValidate="BillFirstNameTextBox"
                                Display="dynamic" ErrorMessage="Required" SetFocusOnError="true" runat="server"
                                ValidationGroup="UpdateCustomerInfoGroup"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;">Last Name: </td>
                        <td style="text-align: left;">
                            <asp:TextBox ID="BillLastNameTextBox" MaxLength="100" Width="228" runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="BillLastNameValidator" ControlToValidate="BillLastNameTextBox"
                                Display="dynamic" ErrorMessage="Required" SetFocusOnError="true" runat="server"
                                ValidationGroup="UpdateCustomerInfoGroup"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;">Address: </td>
                        <td style="text-align: left;">
                            <asp:TextBox ID="BillAddress1TextBox" MaxLength="100" TextMode="multiline" Rows="2"
                                Width="230" runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="BillAddress1Validator" ControlToValidate="BillAddress1TextBox"
                                Display="dynamic" ErrorMessage="Required" SetFocusOnError="true" runat="server"
                                ValidationGroup="UpdateCustomerInfoGroup"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;">Address 2: </td>
                        <td style="text-align: left;">
                            <asp:TextBox ID="BillAddress2TextBox" MaxLength="100" Width="230" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;">City: </td>
                        <td style="text-align: left;">
                            <asp:TextBox ID="BillCityTextBox" MaxLength="100" Width="230" runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="BillCityValidator" ControlToValidate="BillCityTextBox"
                                Display="dynamic" ErrorMessage="Required" SetFocusOnError="true" runat="server"
                                ValidationGroup="UpdateCustomerInfoGroup"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr id="StateRow" runat="server">
                        <td style="text-align: right;">State: </td>
                        <td style="text-align: left;">
                            <asp:DropDownList ID="BillStateProvIDCodeDropDown" runat="server" DataValueField="StateProvIDPostalAbrev"
                                DataTextField="StateProvDisplayName" ValidationGroup="UpdateCustomerInfoGroup">
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator Display="dynamic" ID="BillStateProvIDCodeDropDownValidator"
                                InitialValue="-1" ControlToValidate="BillStateProvIDCodeDropDown" ValidationGroup="UpdateCustomerInfoGroup"
                                runat="server" ErrorMessage="Required" SetFocusOnError="true"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;">ZIP: </td>
                        <td style="text-align: left;">
                            <asp:TextBox ID="BillPostalCodeTextBox" MaxLength="100" Width="228" runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="BillPostalCodeLabelValidator" ControlToValidate="BillPostalCodeTextBox"
                                Display="dynamic" ErrorMessage="Required" SetFocusOnError="true" runat="server"
                                ValidationGroup="UpdateCustomerInfoGroup"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;">Country: </td>
                        <td style="text-align: left;">
                            <asp:DropDownList ID="CountryDropDownList" ValidationGroup="UpdateCustomerInfoGroup"
                                Width="235" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataValueField="CountryIDPostalAbrev"
                                DataTextField="CountryDisplayName" OnSelectedIndexChanged="CountryDropDownList_SelectedIndexChanged">
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator Display="dynamic" ID="CountyRequiredFieldValidator" InitialValue="-1"
                                ControlToValidate="CountryDropDownList" ValidationGroup="UpdateCustomerInfoGroup"
                                runat="server" ErrorMessage="Required" SetFocusOnError="true"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;">Phone: </td>
                        <td style="text-align: left;">
                            <asp:TextBox ID="BillPhonePrimaryTextBox" MaxLength="100" Width="228" runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="BillPhonePrimaryValidator" ControlToValidate="BillPhonePrimaryTextBox"
                                Display="dynamic" ErrorMessage="Required" SetFocusOnError="true" runat="server"
                                ValidationGroup="UpdateCustomerInfoGroup"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;">Ship To Billing Address? </td>
                        <td style="text-align: left;">
                            <asp:CheckBox ID="ShipToBillingAddressCheckbox" CausesValidation="false" ValidationGroup="UpdateCustomerInfoGroup"
                                runat="server" Checked="true" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" style="text-align: center;">
                            <asp:UpdateProgress ID="UpdateProgress1" AssociatedUpdatePanelID="MainUpdatePanel"
                                runat="server">
                                <ProgressTemplate>
                                    <img src="/Files/Themes/<%= Website.DesignFolder %>/loading.gif" alt="" />
                                </ProgressTemplate>
                            </asp:UpdateProgress>
                        </td>
                    </tr>
                </table>
            </ContentTemplate>
        </asp:UpdatePanel>
        <asp:LinkButton ID="UpdateCustomerInfoButton" runat="server" CssClass="buttonPositive"
            Text="Continue" ValidationGroup="UpdateCustomerInfoGroup" OnClick="UpdateCustomerInfoButton_Click" />
    </div>
</asp:Content>
